﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Csharp虚方法
{
    abstract class Animal 
    {
        public string name;

        //抽象属性
        public abstract string Name
        {
            get;
            set;
        }
        public abstract void animShow();
    }

    class dog : Animal 
    {
        public override string Name { get => name; set => name = value; }

        public override void animShow()
        {
            Console.WriteLine("狗狗叫");
        }
    }

    class cat : Animal 
    {
        public override string Name { get =>  name; set => name = value; }

        public override void animShow()
        {
            Console.WriteLine("喵喵叫");
        }
    }
}
